//
//  LZMostSearchCollectionViewCell.m
//  laziz_Consumer
//
//  Created by XMac on 16/10/25.
//  Copyright © 2016年 XBN. All rights reserved.
//

#import "LZMostSearchCollectionViewCell.h"


@interface LZMostSearchCollectionViewCell ()

@property (strong, nonatomic) IBOutlet UILabel *titleLabel;


@end

@implementation LZMostSearchCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.layer.cornerRadius = 3;
    self.layer.masksToBounds = YES;
}


+(CGSize)getCellSizeWithText:(NSString*)text{
    
    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:15.]};
    CGRect titleRect = [text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH, MAXFLOAT)
                                          options:NSStringDrawingUsesLineFragmentOrigin
                                       attributes:attributes
                                          context:nil];
    titleRect.size.width += 30;
    titleRect.size.height = 37;
    return titleRect.size;
}


-(void)changeTitle:(NSString *)xTitle{
    if (xTitle) {
        _titleLabel.text = xTitle;
    }
}

@end
